<template>
   <div id="root" style="width:100%;height:100%;position:absolute;top:0;left:0;padding:0;margin:0;border:hidden;overflow:hidden">
    <router-view></router-view>
  </div>
</template>

<script>
// 引入
import Admin from "./pages/Admin";
import Personal from "./pages/Personal";

import PersonalShop from "./pages/PersonalShop";
//李典
export default {
    name:'App',
    components:{
      Admin,Personal,
      PersonalShop
    },
    created(){
      window.addEventListener('beforeunload', this.saveToken)
      localStorage.removeItem('token')
      localStorage.removeItem('userMsg')
    },
    methods: {
      saveToken(){
        console.log(11111111111);
        console.log(this.$store.state.token);
        localStorage.setItem('token',this.$store.state.store.token)
        localStorage.setItem('userMsg',JSON.stringify(this.$store.state.store.userMsg))
      }
    }
}
</script>
<style lang="less" scoped>
*{
  margin: 0;
  padding: 0;
}
html,body{
  margin: 0;
  padding: 0;
}
// #root{
//   width: 100%;
//   height: 100%;
//   padding:0px;
//   margin:0px;
//   position:absolute;
//   top:0px;
//   left:0px;
//   border: hidden;
//   overflow: hidden;
//  }



